import axios from '@/libs/api.request'

export const getTableData = () => {
  return axios.request({
    url: 'get_table_data',
    method: 'get'
  })
}

export const getDragList = () => {
  return axios.request({
    url: 'get_drag_list',
    method: 'get'
  })
}

export const errorReq = () => {
  return axios.request({
    url: 'error_url',
    method: 'post'
  })
}

export const saveErrorLogger = info => {
  return axios.request({
    url: 'save_error_logger',
    data: info,
    method: 'post'
  })
}

export const uploadImg = formData => {
  return axios.request({
    url: 'image/upload',
    data: formData
  })
}
export const getOrgList = () => {
  return axios.request({
    url: '/Org/getList',
    method: 'get'
  })
}
export const saveOrg = (data) => {
  return axios.request({
    url: '/Org/Save',
    method: 'post',
    data
  })
}
export const delOrg = (data) => {
  return axios.request({
    url: '/Org/Delete?ids=' + data,
    method: 'get'
  })
}
export const getModuleByRole = (data) => {
  return axios.request({
    url: '/module/getModuleByRole?rid=' + data,
    method: 'get'
  })
}

export const saveRoleModule = (data) => {
  return axios.request({
    url: '/module/saveRoleModule',
    method: 'post',
    data
  })
}
export const getRolesByPerson = (data) => {
  return axios.request({
    url: '/roles/getRolesByPerson?userid=' + data,
    method: 'get'
  })
}
export const saveRolePerson = (data) => {
  return axios.request({
    url: '/roles/saveRolePerson',
    method: 'post',
    data
  })
}
export const ccSave = (data) => {
  return axios.request({
    url: '/pound/ccSave',
    method: 'post',
    data
  })
}
